package cn.virens.web.components.weixin.session.standard;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import cn.virens.web.components.weixin.session.AbstractSessionManager;
import cn.virens.web.components.weixin.session.VirWxSession;

public class WxStandardSessionManager extends AbstractSessionManager {

	private Map<String, VirWxSession> sessionMap = new ConcurrentHashMap<>();

	@Override
	public void putStandardSession(VirWxSession session) {
		sessionMap.put(session.getSessionId(), session);
	}

	@Override
	public void removeStandardSession(VirWxSession session) {
		sessionMap.remove(session.getSessionId());
	}

	@Override
	protected VirWxSession findSession(String sessionId) {
		return sessionMap.get(sessionId);
	}

}
